﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Edgar.Frontend.Wpf.Events;
using Edgar.Frontend.Wpf.ViewModels;

namespace Edgar.Frontend.Wpf.Controls
{
    /// <summary>
    /// Interaction logic for Skills.xaml
    /// </summary>
    public partial class Skills : UserControl
    {
        public Skills()
        {
            InitializeComponent();
        }

        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            if (AddButtonClick != null)
                AddButtonClick(this, new EventArgs());
        }

        private void RemoveButton_Click(object sender, RoutedEventArgs e)
        {
            var selectedItem = SkillsListBox.SelectedItem;
            if (selectedItem == null) return;

            if (RemoveButtonClick != null)
                RemoveButtonClick(this, new SkillEventArgs { Name = ((SkillViewModel)selectedItem).Name, Category = ((SkillViewModel)selectedItem).Category });
        }

        public event EventHandler AddButtonClick;
        public event EventHandler<SkillEventArgs> RemoveButtonClick;
    }
}
